//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension SocialMessaging {
    // MARK: Enums

    public enum RegistrationStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case complete = "COMPLETE"
        case incomplete = "INCOMPLETE"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AssociateWhatsAppBusinessAccountInput: AWSEncodableShape {
        /// A JSON object that contains the phone numbers and WhatsApp Business Account to link to your account.
        public let setupFinalization: WhatsAppSetupFinalization?
        /// Contains the callback access token.
        public let signupCallback: WhatsAppSignupCallback?

        @inlinable
        public init(setupFinalization: WhatsAppSetupFinalization? = nil, signupCallback: WhatsAppSignupCallback? = nil) {
            self.setupFinalization = setupFinalization
            self.signupCallback = signupCallback
        }

        public func validate(name: String) throws {
            try self.setupFinalization?.validate(name: "\(name).setupFinalization")
        }

        private enum CodingKeys: String, CodingKey {
            case setupFinalization = "setupFinalization"
            case signupCallback = "signupCallback"
        }
    }

    public struct AssociateWhatsAppBusinessAccountOutput: AWSDecodableShape {
        /// Contains your WhatsApp registration status.
        public let signupCallbackResult: WhatsAppSignupCallbackResult?
        /// The status code for the response.
        public let statusCode: Int?

        @inlinable
        public init(signupCallbackResult: WhatsAppSignupCallbackResult? = nil, statusCode: Int? = nil) {
            self.signupCallbackResult = signupCallbackResult
            self.statusCode = statusCode
        }

        private enum CodingKeys: String, CodingKey {
            case signupCallbackResult = "signupCallbackResult"
            case statusCode = "statusCode"
        }
    }

    public struct CreateWhatsAppMessageTemplateFromLibraryInput: AWSEncodableShape {
        /// The ID of the WhatsApp Business Account to associate with this template.
        public let id: String
        /// The template configuration from Meta's library, including customizations for buttons and body text.
        public let metaLibraryTemplate: MetaLibraryTemplate

        @inlinable
        public init(id: String, metaLibraryTemplate: MetaLibraryTemplate) {
            self.id = id
            self.metaLibraryTemplate = metaLibraryTemplate
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
            try self.metaLibraryTemplate.validate(name: "\(name).metaLibraryTemplate")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "id"
            case metaLibraryTemplate = "metaLibraryTemplate"
        }
    }

    public struct CreateWhatsAppMessageTemplateFromLibraryOutput: AWSDecodableShape {
        /// The category of the template (for example, UTILITY or MARKETING).
        public let category: String?
        /// The numeric ID assigned to the template by Meta.
        public let metaTemplateId: String?
        /// The status of the created template (for example, PENDING or APPROVED).
        public let templateStatus: String?

        @inlinable
        public init(category: String? = nil, metaTemplateId: String? = nil, templateStatus: String? = nil) {
            self.category = category
            self.metaTemplateId = metaTemplateId
            self.templateStatus = templateStatus
        }

        private enum CodingKeys: String, CodingKey {
            case category = "category"
            case metaTemplateId = "metaTemplateId"
            case templateStatus = "templateStatus"
        }
    }

    public struct CreateWhatsAppMessageTemplateInput: AWSEncodableShape {
        /// The ID of the WhatsApp Business Account to associate with this template.
        public let id: String
        /// The complete template definition as a JSON blob.
        public let templateDefinition: AWSBase64Data

        @inlinable
        public init(id: String, templateDefinition: AWSBase64Data) {
            self.id = id
            self.templateDefinition = templateDefinition
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
            try self.validate(self.templateDefinition, name: "templateDefinition", parent: name, max: 6000)
            try self.validate(self.templateDefinition, name: "templateDefinition", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case id = "id"
            case templateDefinition = "templateDefinition"
        }
    }

    public struct CreateWhatsAppMessageTemplateMediaInput: AWSEncodableShape {
        /// The ID of the WhatsApp Business Account associated with this media upload.
        public let id: String
        public let sourceS3File: S3File?

        @inlinable
        public init(id: String, sourceS3File: S3File? = nil) {
            self.id = id
            self.sourceS3File = sourceS3File
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "id"
            case sourceS3File = "sourceS3File"
        }
    }

    public struct CreateWhatsAppMessageTemplateMediaOutput: AWSDecodableShape {
        /// The handle assigned to the uploaded media by Meta, used to reference the media in templates.
        public let metaHeaderHandle: String?

        @inlinable
        public init(metaHeaderHandle: String? = nil) {
            self.metaHeaderHandle = metaHeaderHandle
        }

        private enum CodingKeys: String, CodingKey {
            case metaHeaderHandle = "metaHeaderHandle"
        }
    }

    public struct CreateWhatsAppMessageTemplateOutput: AWSDecodableShape {
        /// The category of the template, such as UTILITY or MARKETING.
        public let category: String?
        /// The numeric ID assigned to the template by Meta.
        public let metaTemplateId: String?
        /// The status of the created template, such as PENDING or APPROVED..
        public let templateStatus: String?

        @inlinable
        public init(category: String? = nil, metaTemplateId: String? = nil, templateStatus: String? = nil) {
            self.category = category
            self.metaTemplateId = metaTemplateId
            self.templateStatus = templateStatus
        }

        private enum CodingKeys: String, CodingKey {
            case category = "category"
            case metaTemplateId = "metaTemplateId"
            case templateStatus = "templateStatus"
        }
    }

    public struct DeleteWhatsAppMessageMediaInput: AWSEncodableShape {
        /// The unique identifier of the media file to delete. Use the mediaId returned from PostWhatsAppMessageMedia.
        public let mediaId: String
        /// The unique identifier of the originating phone number associated with the media. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's id.
        public let originationPhoneNumberId: String

        @inlinable
        public init(mediaId: String, originationPhoneNumberId: String) {
            self.mediaId = mediaId
            self.originationPhoneNumberId = originationPhoneNumberId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.mediaId, key: "mediaId")
            request.encodeQuery(self.originationPhoneNumberId, key: "originationPhoneNumberId")
        }

        public func validate(name: String) throws {
            try self.validate(self.mediaId, name: "mediaId", parent: name, max: 100)
            try self.validate(self.mediaId, name: "mediaId", parent: name, min: 1)
            try self.validate(self.mediaId, name: "mediaId", parent: name, pattern: "^[A-Za-z0-9]+$")
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, max: 100)
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, min: 1)
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, pattern: "(^phone-number-id-.*$)|(^arn:.*:phone-number-id/[0-9a-zA-Z]+$)")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteWhatsAppMessageMediaOutput: AWSDecodableShape {
        /// Success indicator for deleting the media file.
        public let success: Bool?

        @inlinable
        public init(success: Bool? = nil) {
            self.success = success
        }

        private enum CodingKeys: String, CodingKey {
            case success = "success"
        }
    }

    public struct DeleteWhatsAppMessageTemplateInput: AWSEncodableShape {
        /// If true, deletes all language versions of the template.
        public let deleteAllLanguages: Bool?
        /// The ID of the WhatsApp Business Account associated with this template.
        public let id: String
        /// The numeric ID of the template assigned by Meta.
        public let metaTemplateId: String?
        /// The name of the template to delete.
        public let templateName: String

        @inlinable
        public init(deleteAllLanguages: Bool? = nil, id: String, metaTemplateId: String? = nil, templateName: String) {
            self.deleteAllLanguages = deleteAllLanguages
            self.id = id
            self.metaTemplateId = metaTemplateId
            self.templateName = templateName
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.deleteAllLanguages, key: "deleteAllTemplates")
            request.encodeQuery(self.id, key: "id")
            request.encodeQuery(self.metaTemplateId, key: "metaTemplateId")
            request.encodeQuery(self.templateName, key: "templateName")
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
            try self.validate(self.metaTemplateId, name: "metaTemplateId", parent: name, max: 100)
            try self.validate(self.metaTemplateId, name: "metaTemplateId", parent: name, min: 1)
            try self.validate(self.metaTemplateId, name: "metaTemplateId", parent: name, pattern: "^[0-9]+$")
            try self.validate(self.templateName, name: "templateName", parent: name, max: 512)
            try self.validate(self.templateName, name: "templateName", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteWhatsAppMessageTemplateOutput: AWSDecodableShape {
        public init() {}
    }

    public struct DisassociateWhatsAppBusinessAccountInput: AWSEncodableShape {
        /// The unique identifier of your WhatsApp Business Account. WABA identifiers are formatted as waba-01234567890123456789012345678901. Use ListLinkedWhatsAppBusinessAccounts to list all WABAs and their details.
        public let id: String

        @inlinable
        public init(id: String) {
            self.id = id
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.id, key: "id")
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DisassociateWhatsAppBusinessAccountOutput: AWSDecodableShape {
        public init() {}
    }

    public struct GetLinkedWhatsAppBusinessAccountInput: AWSEncodableShape {
        /// The unique identifier, from Amazon Web Services, of the linked WhatsApp Business Account. WABA identifiers are formatted as waba-01234567890123456789012345678901. Use ListLinkedWhatsAppBusinessAccounts to list all WABAs and their details.
        public let id: String

        @inlinable
        public init(id: String) {
            self.id = id
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.id, key: "id")
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetLinkedWhatsAppBusinessAccountOutput: AWSDecodableShape {
        /// The details of the linked WhatsApp Business Account.
        public let account: LinkedWhatsAppBusinessAccount?

        @inlinable
        public init(account: LinkedWhatsAppBusinessAccount? = nil) {
            self.account = account
        }

        private enum CodingKeys: String, CodingKey {
            case account = "account"
        }
    }

    public struct GetLinkedWhatsAppBusinessAccountPhoneNumberInput: AWSEncodableShape {
        /// The unique identifier of the phone number. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's id.
        public let id: String

        @inlinable
        public init(id: String) {
            self.id = id
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.id, key: "id")
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^phone-number-id-.*$)|(^arn:.*:phone-number-id/[0-9a-zA-Z]+$)")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetLinkedWhatsAppBusinessAccountPhoneNumberOutput: AWSDecodableShape {
        /// The WABA identifier linked to the phone number, formatted as waba-01234567890123456789012345678901.
        public let linkedWhatsAppBusinessAccountId: String?
        public let phoneNumber: WhatsAppPhoneNumberDetail?

        @inlinable
        public init(linkedWhatsAppBusinessAccountId: String? = nil, phoneNumber: WhatsAppPhoneNumberDetail? = nil) {
            self.linkedWhatsAppBusinessAccountId = linkedWhatsAppBusinessAccountId
            self.phoneNumber = phoneNumber
        }

        private enum CodingKeys: String, CodingKey {
            case linkedWhatsAppBusinessAccountId = "linkedWhatsAppBusinessAccountId"
            case phoneNumber = "phoneNumber"
        }
    }

    public struct GetWhatsAppMessageMediaInput: AWSEncodableShape {
        /// The bucketName and key of the S3 media file.
        public let destinationS3File: S3File?
        /// The presign url of the media file.
        public let destinationS3PresignedUrl: S3PresignedUrl?
        /// The unique identifier for the media file.
        public let mediaId: String
        /// Set to True to get only the metadata for the file.
        public let metadataOnly: Bool?
        /// The unique identifier of the originating phone number for the WhatsApp message media. The phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's id.
        public let originationPhoneNumberId: String

        @inlinable
        public init(destinationS3File: S3File? = nil, destinationS3PresignedUrl: S3PresignedUrl? = nil, mediaId: String, metadataOnly: Bool? = nil, originationPhoneNumberId: String) {
            self.destinationS3File = destinationS3File
            self.destinationS3PresignedUrl = destinationS3PresignedUrl
            self.mediaId = mediaId
            self.metadataOnly = metadataOnly
            self.originationPhoneNumberId = originationPhoneNumberId
        }

        public func validate(name: String) throws {
            try self.validate(self.mediaId, name: "mediaId", parent: name, max: 100)
            try self.validate(self.mediaId, name: "mediaId", parent: name, min: 1)
            try self.validate(self.mediaId, name: "mediaId", parent: name, pattern: "^[A-Za-z0-9]+$")
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, max: 100)
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, min: 1)
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, pattern: "(^phone-number-id-.*$)|(^arn:.*:phone-number-id/[0-9a-zA-Z]+$)")
        }

        private enum CodingKeys: String, CodingKey {
            case destinationS3File = "destinationS3File"
            case destinationS3PresignedUrl = "destinationS3PresignedUrl"
            case mediaId = "mediaId"
            case metadataOnly = "metadataOnly"
            case originationPhoneNumberId = "originationPhoneNumberId"
        }
    }

    public struct GetWhatsAppMessageMediaOutput: AWSDecodableShape {
        /// The file size of the media, in KB.
        public let fileSize: Int64?
        /// The MIME type of the media.
        public let mimeType: String?

        @inlinable
        public init(fileSize: Int64? = nil, mimeType: String? = nil) {
            self.fileSize = fileSize
            self.mimeType = mimeType
        }

        private enum CodingKeys: String, CodingKey {
            case fileSize = "fileSize"
            case mimeType = "mimeType"
        }
    }

    public struct GetWhatsAppMessageTemplateInput: AWSEncodableShape {
        /// The ID of the WhatsApp Business Account associated with this template.
        public let id: String
        /// The numeric ID of the template assigned by Meta.
        public let metaTemplateId: String

        @inlinable
        public init(id: String, metaTemplateId: String) {
            self.id = id
            self.metaTemplateId = metaTemplateId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.id, key: "id")
            request.encodeQuery(self.metaTemplateId, key: "metaTemplateId")
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
            try self.validate(self.metaTemplateId, name: "metaTemplateId", parent: name, max: 100)
            try self.validate(self.metaTemplateId, name: "metaTemplateId", parent: name, min: 1)
            try self.validate(self.metaTemplateId, name: "metaTemplateId", parent: name, pattern: "^[0-9]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetWhatsAppMessageTemplateOutput: AWSDecodableShape {
        /// The complete template definition as a JSON string (maximum 6000 characters).
        public let template: String?

        @inlinable
        public init(template: String? = nil) {
            self.template = template
        }

        private enum CodingKeys: String, CodingKey {
            case template = "template"
        }
    }

    public struct LibraryTemplateBodyInputs: AWSEncodableShape {
        /// When true, includes a contact number in the template body.
        public let addContactNumber: Bool?
        /// When true, includes a "learn more" link in the template body.
        public let addLearnMoreLink: Bool?
        /// When true, includes security recommendations in the template body.
        public let addSecurityRecommendation: Bool?
        /// When true, includes a package tracking link in the template body.
        public let addTrackPackageLink: Bool?
        /// The number of minutes until a verification code or OTP expires.
        public let codeExpirationMinutes: Int?

        @inlinable
        public init(addContactNumber: Bool? = nil, addLearnMoreLink: Bool? = nil, addSecurityRecommendation: Bool? = nil, addTrackPackageLink: Bool? = nil, codeExpirationMinutes: Int? = nil) {
            self.addContactNumber = addContactNumber
            self.addLearnMoreLink = addLearnMoreLink
            self.addSecurityRecommendation = addSecurityRecommendation
            self.addTrackPackageLink = addTrackPackageLink
            self.codeExpirationMinutes = codeExpirationMinutes
        }

        private enum CodingKeys: String, CodingKey {
            case addContactNumber = "addContactNumber"
            case addLearnMoreLink = "addLearnMoreLink"
            case addSecurityRecommendation = "addSecurityRecommendation"
            case addTrackPackageLink = "addTrackPackageLink"
            case codeExpirationMinutes = "codeExpirationMinutes"
        }
    }

    public struct LibraryTemplateButtonInput: AWSEncodableShape {
        /// The type of one-time password for OTP buttons.
        public let otpType: String?
        /// The phone number in E.164 format for CALL-type buttons.
        public let phoneNumber: String?
        /// List of supported applications for this button type.
        public let supportedApps: [[String: String]]?
        /// The type of button (for example, QUICK_REPLY, CALL, or URL).
        public let type: String?
        /// The URL with dynamic parameters for URL-type buttons.
        public let url: [String: String]?
        /// When true, indicates acceptance of zero-tap terms for the button.
        public let zeroTapTermsAccepted: Bool?

        @inlinable
        public init(otpType: String? = nil, phoneNumber: String? = nil, supportedApps: [[String: String]]? = nil, type: String? = nil, url: [String: String]? = nil, zeroTapTermsAccepted: Bool? = nil) {
            self.otpType = otpType
            self.phoneNumber = phoneNumber
            self.supportedApps = supportedApps
            self.type = type
            self.url = url
            self.zeroTapTermsAccepted = zeroTapTermsAccepted
        }

        public func validate(name: String) throws {
            try self.validate(self.otpType, name: "otpType", parent: name, max: 25)
            try self.validate(self.otpType, name: "otpType", parent: name, min: 1)
            try self.validate(self.phoneNumber, name: "phoneNumber", parent: name, max: 20)
            try self.validate(self.phoneNumber, name: "phoneNumber", parent: name, min: 1)
            try self.supportedApps?.forEach {
                try validate($0, name: "supportedApps[]", parent: name, max: 10)
            }
            try self.validate(self.type, name: "type", parent: name, max: 25)
            try self.validate(self.type, name: "type", parent: name, min: 1)
            try self.validate(self.url, name: "url", parent: name, max: 10)
        }

        private enum CodingKeys: String, CodingKey {
            case otpType = "otpType"
            case phoneNumber = "phoneNumber"
            case supportedApps = "supportedApps"
            case type = "type"
            case url = "url"
            case zeroTapTermsAccepted = "zeroTapTermsAccepted"
        }
    }

    public struct LibraryTemplateButtonList: AWSDecodableShape {
        /// The type of one-time password for OTP buttons.
        public let otpType: String?
        /// The phone number in E.164 format for CALL-type buttons.
        public let phoneNumber: String?
        /// List of supported applications for this button type.
        public let supportedApps: [[String: String]]?
        /// The text displayed on the button (maximum 40 characters).
        public let text: String?
        /// The type of button (for example, QUICK_REPLY, CALL, or URL).
        public let type: String?
        /// The URL for URL-type buttons.
        public let url: String?
        /// When true, indicates acceptance of zero-tap terms for the button.
        public let zeroTapTermsAccepted: Bool?

        @inlinable
        public init(otpType: String? = nil, phoneNumber: String? = nil, supportedApps: [[String: String]]? = nil, text: String? = nil, type: String? = nil, url: String? = nil, zeroTapTermsAccepted: Bool? = nil) {
            self.otpType = otpType
            self.phoneNumber = phoneNumber
            self.supportedApps = supportedApps
            self.text = text
            self.type = type
            self.url = url
            self.zeroTapTermsAccepted = zeroTapTermsAccepted
        }

        private enum CodingKeys: String, CodingKey {
            case otpType = "otpType"
            case phoneNumber = "phoneNumber"
            case supportedApps = "supportedApps"
            case text = "text"
            case type = "type"
            case url = "url"
            case zeroTapTermsAccepted = "zeroTapTermsAccepted"
        }
    }

    public struct LinkedWhatsAppBusinessAccount: AWSDecodableShape {
        /// The ARN of the linked WhatsApp Business Account.
        public let arn: String
        /// The event destinations for the linked WhatsApp Business Account.
        public let eventDestinations: [WhatsAppBusinessAccountEventDestination]
        /// The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901.
        public let id: String
        /// The date the WhatsApp Business Account was linked.
        public let linkDate: Date
        /// The phone numbers associated with the Linked WhatsApp Business Account.
        public let phoneNumbers: [WhatsAppPhoneNumberSummary]
        /// The registration status of the linked WhatsApp Business Account.
        public let registrationStatus: RegistrationStatus
        /// The WhatsApp Business Account ID from meta.
        public let wabaId: String
        /// The name of the linked WhatsApp Business Account.
        public let wabaName: String

        @inlinable
        public init(arn: String, eventDestinations: [WhatsAppBusinessAccountEventDestination], id: String, linkDate: Date, phoneNumbers: [WhatsAppPhoneNumberSummary], registrationStatus: RegistrationStatus, wabaId: String, wabaName: String) {
            self.arn = arn
            self.eventDestinations = eventDestinations
            self.id = id
            self.linkDate = linkDate
            self.phoneNumbers = phoneNumbers
            self.registrationStatus = registrationStatus
            self.wabaId = wabaId
            self.wabaName = wabaName
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case eventDestinations = "eventDestinations"
            case id = "id"
            case linkDate = "linkDate"
            case phoneNumbers = "phoneNumbers"
            case registrationStatus = "registrationStatus"
            case wabaId = "wabaId"
            case wabaName = "wabaName"
        }
    }

    public struct LinkedWhatsAppBusinessAccountIdMetaData: AWSDecodableShape {
        /// The name of your account.
        public let accountName: String?
        /// The registration status of the linked WhatsApp Business Account.
        public let registrationStatus: RegistrationStatus?
        /// The details for unregistered WhatsApp phone numbers.
        public let unregisteredWhatsAppPhoneNumbers: [WhatsAppPhoneNumberDetail]?
        /// The Amazon Resource Name (ARN) of the WhatsApp Business Account ID.
        public let wabaId: String?

        @inlinable
        public init(accountName: String? = nil, registrationStatus: RegistrationStatus? = nil, unregisteredWhatsAppPhoneNumbers: [WhatsAppPhoneNumberDetail]? = nil, wabaId: String? = nil) {
            self.accountName = accountName
            self.registrationStatus = registrationStatus
            self.unregisteredWhatsAppPhoneNumbers = unregisteredWhatsAppPhoneNumbers
            self.wabaId = wabaId
        }

        private enum CodingKeys: String, CodingKey {
            case accountName = "accountName"
            case registrationStatus = "registrationStatus"
            case unregisteredWhatsAppPhoneNumbers = "unregisteredWhatsAppPhoneNumbers"
            case wabaId = "wabaId"
        }
    }

    public struct LinkedWhatsAppBusinessAccountSummary: AWSDecodableShape {
        /// The ARN of the linked WhatsApp Business Account.
        public let arn: String
        /// The event destinations for the linked WhatsApp Business Account.
        public let eventDestinations: [WhatsAppBusinessAccountEventDestination]
        /// The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901.
        public let id: String
        /// The date the WhatsApp Business Account was linked.
        public let linkDate: Date
        /// The registration status of the linked WhatsApp Business Account.
        public let registrationStatus: RegistrationStatus
        /// The WhatsApp Business Account ID provided by Meta.
        public let wabaId: String
        /// The name of the linked WhatsApp Business Account.
        public let wabaName: String

        @inlinable
        public init(arn: String, eventDestinations: [WhatsAppBusinessAccountEventDestination], id: String, linkDate: Date, registrationStatus: RegistrationStatus, wabaId: String, wabaName: String) {
            self.arn = arn
            self.eventDestinations = eventDestinations
            self.id = id
            self.linkDate = linkDate
            self.registrationStatus = registrationStatus
            self.wabaId = wabaId
            self.wabaName = wabaName
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case eventDestinations = "eventDestinations"
            case id = "id"
            case linkDate = "linkDate"
            case registrationStatus = "registrationStatus"
            case wabaId = "wabaId"
            case wabaName = "wabaName"
        }
    }

    public struct ListLinkedWhatsAppBusinessAccountsInput: AWSEncodableShape {
        /// The maximum number of results to return.
        public let maxResults: Int?
        /// The next token for pagination.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 600)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListLinkedWhatsAppBusinessAccountsOutput: AWSDecodableShape {
        /// A list of WhatsApp Business Accounts linked to your Amazon Web Services account.
        public let linkedAccounts: [LinkedWhatsAppBusinessAccountSummary]?
        /// The next token for pagination.
        public let nextToken: String?

        @inlinable
        public init(linkedAccounts: [LinkedWhatsAppBusinessAccountSummary]? = nil, nextToken: String? = nil) {
            self.linkedAccounts = linkedAccounts
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case linkedAccounts = "linkedAccounts"
            case nextToken = "nextToken"
        }
    }

    public struct ListTagsForResourceInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource to retrieve the tags from.
        public let resourceArn: String

        @inlinable
        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.resourceArn, key: "resourceArn")
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:.*$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceOutput: AWSDecodableShape {
        /// The status code of the response.
        public let statusCode: Int?
        /// The tags for the resource.
        public let tags: [Tag]?

        @inlinable
        public init(statusCode: Int? = nil, tags: [Tag]? = nil) {
            self.statusCode = statusCode
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case statusCode = "statusCode"
            case tags = "tags"
        }
    }

    public struct ListWhatsAppMessageTemplatesInput: AWSEncodableShape {
        /// The ID of the WhatsApp Business Account to list templates for.
        public let id: String
        /// The maximum number of results to return per page (1-100).
        public let maxResults: Int?
        /// The token for the next page of results.
        public let nextToken: String?

        @inlinable
        public init(id: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.id = id
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.id, key: "id")
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 600)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListWhatsAppMessageTemplatesOutput: AWSDecodableShape {
        /// The token to retrieve the next page of results, if any.
        public let nextToken: String?
        /// A list of template summaries.
        public let templates: [TemplateSummary]?

        @inlinable
        public init(nextToken: String? = nil, templates: [TemplateSummary]? = nil) {
            self.nextToken = nextToken
            self.templates = templates
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "nextToken"
            case templates = "templates"
        }
    }

    public struct ListWhatsAppTemplateLibraryInput: AWSEncodableShape {
        /// Map of filters to apply (searchKey, topic, usecase, industry, language).
        public let filters: [String: String]?
        /// The ID of the WhatsApp Business Account to list library templates for.
        public let id: String
        /// The maximum number of results to return per page (1-100).
        public let maxResults: Int?
        /// The token for the next page of results.
        public let nextToken: String?

        @inlinable
        public init(filters: [String: String]? = nil, id: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.filters = filters
            self.id = id
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encodeIfPresent(self.filters, forKey: .filters)
            request.encodeQuery(self.id, key: "id")
            try container.encodeIfPresent(self.maxResults, forKey: .maxResults)
            try container.encodeIfPresent(self.nextToken, forKey: .nextToken)
        }

        public func validate(name: String) throws {
            try self.validate(self.filters, name: "filters", parent: name, max: 10)
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 600)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case filters = "filters"
            case maxResults = "maxResults"
            case nextToken = "nextToken"
        }
    }

    public struct ListWhatsAppTemplateLibraryOutput: AWSDecodableShape {
        /// A list of templates from Meta's library.
        public let metaLibraryTemplates: [MetaLibraryTemplateDefinition]?
        /// The token to retrieve the next page of results, if any.
        public let nextToken: String?

        @inlinable
        public init(metaLibraryTemplates: [MetaLibraryTemplateDefinition]? = nil, nextToken: String? = nil) {
            self.metaLibraryTemplates = metaLibraryTemplates
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case metaLibraryTemplates = "metaLibraryTemplates"
            case nextToken = "nextToken"
        }
    }

    public struct MetaLibraryTemplate: AWSEncodableShape {
        /// Body text customizations for the template.
        public let libraryTemplateBodyInputs: LibraryTemplateBodyInputs?
        /// Button customizations for the template.
        public let libraryTemplateButtonInputs: [LibraryTemplateButtonInput]?
        /// The name of the template in Meta's library.
        public let libraryTemplateName: String
        /// The category of the template (for example, UTILITY or MARKETING).
        public let templateCategory: String
        /// The language code for the template (for example, en_US).
        public let templateLanguage: String
        /// The name to assign to the template.
        public let templateName: String

        @inlinable
        public init(libraryTemplateBodyInputs: LibraryTemplateBodyInputs? = nil, libraryTemplateButtonInputs: [LibraryTemplateButtonInput]? = nil, libraryTemplateName: String, templateCategory: String, templateLanguage: String, templateName: String) {
            self.libraryTemplateBodyInputs = libraryTemplateBodyInputs
            self.libraryTemplateButtonInputs = libraryTemplateButtonInputs
            self.libraryTemplateName = libraryTemplateName
            self.templateCategory = templateCategory
            self.templateLanguage = templateLanguage
            self.templateName = templateName
        }

        public func validate(name: String) throws {
            try self.libraryTemplateButtonInputs?.forEach {
                try $0.validate(name: "\(name).libraryTemplateButtonInputs[]")
            }
            try self.validate(self.libraryTemplateName, name: "libraryTemplateName", parent: name, max: 512)
            try self.validate(self.libraryTemplateName, name: "libraryTemplateName", parent: name, min: 1)
            try self.validate(self.templateCategory, name: "templateCategory", parent: name, max: 100)
            try self.validate(self.templateCategory, name: "templateCategory", parent: name, min: 1)
            try self.validate(self.templateLanguage, name: "templateLanguage", parent: name, max: 6)
            try self.validate(self.templateLanguage, name: "templateLanguage", parent: name, min: 1)
            try self.validate(self.templateName, name: "templateName", parent: name, max: 512)
            try self.validate(self.templateName, name: "templateName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case libraryTemplateBodyInputs = "libraryTemplateBodyInputs"
            case libraryTemplateButtonInputs = "libraryTemplateButtonInputs"
            case libraryTemplateName = "libraryTemplateName"
            case templateCategory = "templateCategory"
            case templateLanguage = "templateLanguage"
            case templateName = "templateName"
        }
    }

    public struct MetaLibraryTemplateDefinition: AWSDecodableShape {
        /// The body text of the template.
        public let templateBody: String?
        /// The buttons included in the template.
        public let templateButtons: [LibraryTemplateButtonList]?
        /// The category of the template (for example, UTILITY or MARKETING).
        public let templateCategory: String?
        /// The header text of the template.
        public let templateHeader: String?
        /// The ID of the template in Meta's library.
        public let templateId: String?
        /// The industries the template is designed for.
        public let templateIndustry: [String]?
        /// The language code for the template (for example, en_US).
        public let templateLanguage: String?
        /// The name of the template.
        public let templateName: String?
        /// The topic or subject matter of the template.
        public let templateTopic: String?
        /// The intended use case for the template.
        public let templateUseCase: String?

        @inlinable
        public init(templateBody: String? = nil, templateButtons: [LibraryTemplateButtonList]? = nil, templateCategory: String? = nil, templateHeader: String? = nil, templateId: String? = nil, templateIndustry: [String]? = nil, templateLanguage: String? = nil, templateName: String? = nil, templateTopic: String? = nil, templateUseCase: String? = nil) {
            self.templateBody = templateBody
            self.templateButtons = templateButtons
            self.templateCategory = templateCategory
            self.templateHeader = templateHeader
            self.templateId = templateId
            self.templateIndustry = templateIndustry
            self.templateLanguage = templateLanguage
            self.templateName = templateName
            self.templateTopic = templateTopic
            self.templateUseCase = templateUseCase
        }

        private enum CodingKeys: String, CodingKey {
            case templateBody = "templateBody"
            case templateButtons = "templateButtons"
            case templateCategory = "templateCategory"
            case templateHeader = "templateHeader"
            case templateId = "templateId"
            case templateIndustry = "templateIndustry"
            case templateLanguage = "templateLanguage"
            case templateName = "templateName"
            case templateTopic = "templateTopic"
            case templateUseCase = "templateUseCase"
        }
    }

    public struct PostWhatsAppMessageMediaInput: AWSEncodableShape {
        /// The ID of the phone number to associate with the WhatsApp media file. The phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount  to find a phone number's id.
        public let originationPhoneNumberId: String
        /// The source S3 url for the media file.
        public let sourceS3File: S3File?
        /// The source presign url of the media file.
        public let sourceS3PresignedUrl: S3PresignedUrl?

        @inlinable
        public init(originationPhoneNumberId: String, sourceS3File: S3File? = nil, sourceS3PresignedUrl: S3PresignedUrl? = nil) {
            self.originationPhoneNumberId = originationPhoneNumberId
            self.sourceS3File = sourceS3File
            self.sourceS3PresignedUrl = sourceS3PresignedUrl
        }

        public func validate(name: String) throws {
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, max: 100)
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, min: 1)
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, pattern: "(^phone-number-id-.*$)|(^arn:.*:phone-number-id/[0-9a-zA-Z]+$)")
        }

        private enum CodingKeys: String, CodingKey {
            case originationPhoneNumberId = "originationPhoneNumberId"
            case sourceS3File = "sourceS3File"
            case sourceS3PresignedUrl = "sourceS3PresignedUrl"
        }
    }

    public struct PostWhatsAppMessageMediaOutput: AWSDecodableShape {
        /// The unique identifier of the posted WhatsApp message.
        public let mediaId: String?

        @inlinable
        public init(mediaId: String? = nil) {
            self.mediaId = mediaId
        }

        private enum CodingKeys: String, CodingKey {
            case mediaId = "mediaId"
        }
    }

    public struct PutWhatsAppBusinessAccountEventDestinationsInput: AWSEncodableShape {
        /// An array of WhatsAppBusinessAccountEventDestination event destinations.
        public let eventDestinations: [WhatsAppBusinessAccountEventDestination]
        /// The unique identifier of your WhatsApp Business Account. WABA identifiers are formatted as waba-01234567890123456789012345678901. Use ListLinkedWhatsAppBusinessAccounts to list all WABAs and their details.
        public let id: String

        @inlinable
        public init(eventDestinations: [WhatsAppBusinessAccountEventDestination], id: String) {
            self.eventDestinations = eventDestinations
            self.id = id
        }

        public func validate(name: String) throws {
            try self.eventDestinations.forEach {
                try $0.validate(name: "\(name).eventDestinations[]")
            }
            try self.validate(self.eventDestinations, name: "eventDestinations", parent: name, max: 1)
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
        }

        private enum CodingKeys: String, CodingKey {
            case eventDestinations = "eventDestinations"
            case id = "id"
        }
    }

    public struct PutWhatsAppBusinessAccountEventDestinationsOutput: AWSDecodableShape {
        public init() {}
    }

    public struct S3File: AWSEncodableShape {
        /// The bucket name.
        public let bucketName: String
        /// The object key of the media file.
        public let key: String

        @inlinable
        public init(bucketName: String, key: String) {
            self.bucketName = bucketName
            self.key = key
        }

        private enum CodingKeys: String, CodingKey {
            case bucketName = "bucketName"
            case key = "key"
        }
    }

    public struct S3PresignedUrl: AWSEncodableShape {
        /// A map of headers and their values. You must specify the Content-Type header when using PostWhatsAppMessageMedia. For a list of common headers, see Common Request Headers in the Amazon S3 API Reference
        public let headers: [String: String]
        /// The presign url to the object.
        public let url: String

        @inlinable
        public init(headers: [String: String], url: String) {
            self.headers = headers
            self.url = url
        }

        private enum CodingKeys: String, CodingKey {
            case headers = "headers"
            case url = "url"
        }
    }

    public struct SendWhatsAppMessageInput: AWSEncodableShape {
        /// The message to send through WhatsApp. The length is in KB. The message field passes through a WhatsApp Message object, see Messages in the WhatsApp Business Platform Cloud API Reference.
        public let message: AWSBase64Data
        /// The API version for the request formatted as v{VersionNumber}. For a list of supported API versions and Amazon Web Services Regions, see  Amazon Web Services End User Messaging Social API Service Endpoints in the Amazon Web Services General Reference.
        public let metaApiVersion: String
        /// The ID of the phone number used to send the WhatsApp message. If you are sending a media file only the originationPhoneNumberId used to upload the file can be used. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's id.
        public let originationPhoneNumberId: String

        @inlinable
        public init(message: AWSBase64Data, metaApiVersion: String, originationPhoneNumberId: String) {
            self.message = message
            self.metaApiVersion = metaApiVersion
            self.originationPhoneNumberId = originationPhoneNumberId
        }

        public func validate(name: String) throws {
            try self.validate(self.message, name: "message", parent: name, max: 2048000)
            try self.validate(self.message, name: "message", parent: name, min: 1)
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, max: 100)
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, min: 1)
            try self.validate(self.originationPhoneNumberId, name: "originationPhoneNumberId", parent: name, pattern: "(^phone-number-id-.*$)|(^arn:.*:phone-number-id/[0-9a-zA-Z]+$)")
        }

        private enum CodingKeys: String, CodingKey {
            case message = "message"
            case metaApiVersion = "metaApiVersion"
            case originationPhoneNumberId = "originationPhoneNumberId"
        }
    }

    public struct SendWhatsAppMessageOutput: AWSDecodableShape {
        /// The unique identifier of the message.
        public let messageId: String?

        @inlinable
        public init(messageId: String? = nil) {
            self.messageId = messageId
        }

        private enum CodingKeys: String, CodingKey {
            case messageId = "messageId"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// The tag key.
        public let key: String
        /// The tag value.
        public let value: String?

        @inlinable
        public init(key: String, value: String? = nil) {
            self.key = key
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case key = "key"
            case value = "value"
        }
    }

    public struct TagResourceInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource to tag.
        public let resourceArn: String
        /// The tags to add to the resource.
        public let tags: [Tag]

        @inlinable
        public init(resourceArn: String, tags: [Tag]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:.*$")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "resourceArn"
            case tags = "tags"
        }
    }

    public struct TagResourceOutput: AWSDecodableShape {
        /// The status code of the tag resource operation.
        public let statusCode: Int?

        @inlinable
        public init(statusCode: Int? = nil) {
            self.statusCode = statusCode
        }

        private enum CodingKeys: String, CodingKey {
            case statusCode = "statusCode"
        }
    }

    public struct TemplateSummary: AWSDecodableShape {
        /// The numeric ID assigned to the template by Meta.
        public let metaTemplateId: String?
        /// The category of the template (for example, UTILITY or MARKETING).
        public let templateCategory: String?
        /// The language code of the template (for example, en_US).
        public let templateLanguage: String?
        /// The name of the template.
        public let templateName: String?
        /// The quality score assigned to the template by Meta.
        public let templateQualityScore: String?
        /// The current status of the template (for example, APPROVED, PENDING, or REJECTED).
        public let templateStatus: String?

        @inlinable
        public init(metaTemplateId: String? = nil, templateCategory: String? = nil, templateLanguage: String? = nil, templateName: String? = nil, templateQualityScore: String? = nil, templateStatus: String? = nil) {
            self.metaTemplateId = metaTemplateId
            self.templateCategory = templateCategory
            self.templateLanguage = templateLanguage
            self.templateName = templateName
            self.templateQualityScore = templateQualityScore
            self.templateStatus = templateStatus
        }

        private enum CodingKeys: String, CodingKey {
            case metaTemplateId = "metaTemplateId"
            case templateCategory = "templateCategory"
            case templateLanguage = "templateLanguage"
            case templateName = "templateName"
            case templateQualityScore = "templateQualityScore"
            case templateStatus = "templateStatus"
        }
    }

    public struct UntagResourceInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource to remove tags from.
        public let resourceArn: String
        /// The keys of the tags to remove from the resource.
        public let tagKeys: [String]

        @inlinable
        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:.*$")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "resourceArn"
            case tagKeys = "tagKeys"
        }
    }

    public struct UntagResourceOutput: AWSDecodableShape {
        /// The status code of the untag resource operation.
        public let statusCode: Int?

        @inlinable
        public init(statusCode: Int? = nil) {
            self.statusCode = statusCode
        }

        private enum CodingKeys: String, CodingKey {
            case statusCode = "statusCode"
        }
    }

    public struct UpdateWhatsAppMessageTemplateInput: AWSEncodableShape {
        /// The ID of the WhatsApp Business Account associated with this template.
        public let id: String
        /// The numeric ID of the template assigned by Meta.
        public let metaTemplateId: String
        /// The new category for the template (for example, UTILITY or MARKETING).
        public let templateCategory: String?
        /// The updated components of the template as a JSON blob (maximum 3000 characters).
        public let templateComponents: AWSBase64Data?

        @inlinable
        public init(id: String, metaTemplateId: String, templateCategory: String? = nil, templateComponents: AWSBase64Data? = nil) {
            self.id = id
            self.metaTemplateId = metaTemplateId
            self.templateCategory = templateCategory
            self.templateComponents = templateComponents
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
            try self.validate(self.metaTemplateId, name: "metaTemplateId", parent: name, max: 100)
            try self.validate(self.metaTemplateId, name: "metaTemplateId", parent: name, min: 1)
            try self.validate(self.metaTemplateId, name: "metaTemplateId", parent: name, pattern: "^[0-9]+$")
            try self.validate(self.templateCategory, name: "templateCategory", parent: name, max: 100)
            try self.validate(self.templateCategory, name: "templateCategory", parent: name, min: 1)
            try self.validate(self.templateComponents, name: "templateComponents", parent: name, max: 3000)
            try self.validate(self.templateComponents, name: "templateComponents", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case id = "id"
            case metaTemplateId = "metaTemplateId"
            case templateCategory = "templateCategory"
            case templateComponents = "templateComponents"
        }
    }

    public struct UpdateWhatsAppMessageTemplateOutput: AWSDecodableShape {
        public init() {}
    }

    public struct WabaPhoneNumberSetupFinalization: AWSEncodableShape {
        /// The two letter ISO region for the location of where Meta will store data.  Asia–Pacific (APAC)    Australia AU    Indonesia ID    India IN    Japan JP    Singapore SG    South Korea KR     Europe    Germany DE    Switzerland CH    United Kingdom GB     Latin America (LATAM)    Brazil BR     Middle East and Africa (MEA)    Bahrain BH    South Africa ZA    United Arab Emirates AE     North America (NORAM)    Canada CA
        public let dataLocalizationRegion: String?
        /// The unique identifier of the originating phone number associated with the media. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's id.
        public let id: String
        /// An array of key and value pair tags.
        public let tags: [Tag]?
        /// The PIN to use for two-step verification. To reset your PIN follow the directions in Updating PIN in the WhatsApp Business Platform Cloud API Reference.
        public let twoFactorPin: String

        @inlinable
        public init(dataLocalizationRegion: String? = nil, id: String, tags: [Tag]? = nil, twoFactorPin: String) {
            self.dataLocalizationRegion = dataLocalizationRegion
            self.id = id
            self.tags = tags
            self.twoFactorPin = twoFactorPin
        }

        public func validate(name: String) throws {
            try self.validate(self.dataLocalizationRegion, name: "dataLocalizationRegion", parent: name, pattern: "^[A-Z]{2}$")
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.twoFactorPin, name: "twoFactorPin", parent: name, max: 6)
            try self.validate(self.twoFactorPin, name: "twoFactorPin", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case dataLocalizationRegion = "dataLocalizationRegion"
            case id = "id"
            case tags = "tags"
            case twoFactorPin = "twoFactorPin"
        }
    }

    public struct WabaSetupFinalization: AWSEncodableShape {
        /// The event destinations for the linked WhatsApp Business Account.
        public let eventDestinations: [WhatsAppBusinessAccountEventDestination]?
        /// The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901.
        public let id: String?
        /// An array of key and value pair tags.
        public let tags: [Tag]?

        @inlinable
        public init(eventDestinations: [WhatsAppBusinessAccountEventDestination]? = nil, id: String? = nil, tags: [Tag]? = nil) {
            self.eventDestinations = eventDestinations
            self.id = id
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.eventDestinations?.forEach {
                try $0.validate(name: "\(name).eventDestinations[]")
            }
            try self.validate(self.eventDestinations, name: "eventDestinations", parent: name, max: 1)
            try self.validate(self.id, name: "id", parent: name, max: 100)
            try self.validate(self.id, name: "id", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case eventDestinations = "eventDestinations"
            case id = "id"
            case tags = "tags"
        }
    }

    public struct WhatsAppBusinessAccountEventDestination: AWSEncodableShape & AWSDecodableShape {
        /// The ARN of the event destination.
        public let eventDestinationArn: String
        /// The Amazon Resource Name (ARN) of an Identity and Access Management role that is able to import phone numbers and write events.
        public let roleArn: String?

        @inlinable
        public init(eventDestinationArn: String, roleArn: String? = nil) {
            self.eventDestinationArn = eventDestinationArn
            self.roleArn = roleArn
        }

        public func validate(name: String) throws {
            try self.validate(self.eventDestinationArn, name: "eventDestinationArn", parent: name, max: 2048)
            try self.validate(self.eventDestinationArn, name: "eventDestinationArn", parent: name, pattern: "^arn:.*:[a-z-]+([/:](.*))?$")
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "^arn:aws:iam::\\d{12}:role\\/[a-zA-Z0-9+=,.@\\-_]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case eventDestinationArn = "eventDestinationArn"
            case roleArn = "roleArn"
        }
    }

    public struct WhatsAppPhoneNumberDetail: AWSDecodableShape {
        /// The ARN of the WhatsApp phone number.
        public let arn: String
        /// The geographic region where the WhatsApp phone number's data is stored and processed.
        public let dataLocalizationRegion: String?
        /// The phone number that appears in the recipients display.
        public let displayPhoneNumber: String
        /// The display name for this phone number.
        public let displayPhoneNumberName: String
        /// The phone number ID from Meta.
        public let metaPhoneNumberId: String
        /// The phone number for sending WhatsApp.
        public let phoneNumber: String
        /// The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.
        public let phoneNumberId: String
        /// The quality rating of the phone number.
        public let qualityRating: String

        @inlinable
        public init(arn: String, dataLocalizationRegion: String? = nil, displayPhoneNumber: String, displayPhoneNumberName: String, metaPhoneNumberId: String, phoneNumber: String, phoneNumberId: String, qualityRating: String) {
            self.arn = arn
            self.dataLocalizationRegion = dataLocalizationRegion
            self.displayPhoneNumber = displayPhoneNumber
            self.displayPhoneNumberName = displayPhoneNumberName
            self.metaPhoneNumberId = metaPhoneNumberId
            self.phoneNumber = phoneNumber
            self.phoneNumberId = phoneNumberId
            self.qualityRating = qualityRating
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case dataLocalizationRegion = "dataLocalizationRegion"
            case displayPhoneNumber = "displayPhoneNumber"
            case displayPhoneNumberName = "displayPhoneNumberName"
            case metaPhoneNumberId = "metaPhoneNumberId"
            case phoneNumber = "phoneNumber"
            case phoneNumberId = "phoneNumberId"
            case qualityRating = "qualityRating"
        }
    }

    public struct WhatsAppPhoneNumberSummary: AWSDecodableShape {
        /// The full Amazon Resource Name (ARN) for the phone number.
        public let arn: String
        /// The geographic region where the WhatsApp phone number's data is stored and processed.
        public let dataLocalizationRegion: String?
        /// The phone number that appears in the recipients display.
        public let displayPhoneNumber: String
        /// The display name for this phone number.
        public let displayPhoneNumberName: String
        /// The phone number ID from Meta.
        public let metaPhoneNumberId: String
        /// The phone number associated with the Linked WhatsApp Business Account.
        public let phoneNumber: String
        /// The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.
        public let phoneNumberId: String
        /// The quality rating of the phone number. This is from Meta.
        public let qualityRating: String

        @inlinable
        public init(arn: String, dataLocalizationRegion: String? = nil, displayPhoneNumber: String, displayPhoneNumberName: String, metaPhoneNumberId: String, phoneNumber: String, phoneNumberId: String, qualityRating: String) {
            self.arn = arn
            self.dataLocalizationRegion = dataLocalizationRegion
            self.displayPhoneNumber = displayPhoneNumber
            self.displayPhoneNumberName = displayPhoneNumberName
            self.metaPhoneNumberId = metaPhoneNumberId
            self.phoneNumber = phoneNumber
            self.phoneNumberId = phoneNumberId
            self.qualityRating = qualityRating
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case dataLocalizationRegion = "dataLocalizationRegion"
            case displayPhoneNumber = "displayPhoneNumber"
            case displayPhoneNumberName = "displayPhoneNumberName"
            case metaPhoneNumberId = "metaPhoneNumberId"
            case phoneNumber = "phoneNumber"
            case phoneNumberId = "phoneNumberId"
            case qualityRating = "qualityRating"
        }
    }

    public struct WhatsAppSetupFinalization: AWSEncodableShape {
        /// An Amazon Web Services access token generated by WhatsAppSignupCallback and used by WhatsAppSetupFinalization.
        public let associateInProgressToken: String
        /// Used to add a new phone number to an existing WhatsApp Business Account. This field can't be used when the waba field is present.
        public let phoneNumberParent: String?
        /// An array of WabaPhoneNumberSetupFinalization objects containing the details of each phone number associated with the WhatsApp Business Account.
        public let phoneNumbers: [WabaPhoneNumberSetupFinalization]
        /// Used to create a new WhatsApp Business Account and add a phone number. This field can't be used when the phoneNumberParent field is present.
        public let waba: WabaSetupFinalization?

        @inlinable
        public init(associateInProgressToken: String, phoneNumberParent: String? = nil, phoneNumbers: [WabaPhoneNumberSetupFinalization], waba: WabaSetupFinalization? = nil) {
            self.associateInProgressToken = associateInProgressToken
            self.phoneNumberParent = phoneNumberParent
            self.phoneNumbers = phoneNumbers
            self.waba = waba
        }

        public func validate(name: String) throws {
            try self.validate(self.associateInProgressToken, name: "associateInProgressToken", parent: name, max: 50)
            try self.validate(self.phoneNumberParent, name: "phoneNumberParent", parent: name, max: 100)
            try self.validate(self.phoneNumberParent, name: "phoneNumberParent", parent: name, min: 1)
            try self.validate(self.phoneNumberParent, name: "phoneNumberParent", parent: name, pattern: "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)")
            try self.phoneNumbers.forEach {
                try $0.validate(name: "\(name).phoneNumbers[]")
            }
            try self.waba?.validate(name: "\(name).waba")
        }

        private enum CodingKeys: String, CodingKey {
            case associateInProgressToken = "associateInProgressToken"
            case phoneNumberParent = "phoneNumberParent"
            case phoneNumbers = "phoneNumbers"
            case waba = "waba"
        }
    }

    public struct WhatsAppSignupCallback: AWSEncodableShape {
        /// The access token for your WhatsApp Business Account. The accessToken value is provided by Meta.
        public let accessToken: String
        /// The URL where WhatsApp will send callback notifications for this account.
        public let callbackUrl: String?

        @inlinable
        public init(accessToken: String, callbackUrl: String? = nil) {
            self.accessToken = accessToken
            self.callbackUrl = callbackUrl
        }

        private enum CodingKeys: String, CodingKey {
            case accessToken = "accessToken"
            case callbackUrl = "callbackUrl"
        }
    }

    public struct WhatsAppSignupCallbackResult: AWSDecodableShape {
        /// An Amazon Web Services access token generated by WhatsAppSignupCallback and used by WhatsAppSetupFinalization.
        public let associateInProgressToken: String?
        /// A LinkedWhatsAppBusinessAccountIdMetaData object map containing the details of any WhatsAppBusiness accounts that have incomplete setup.
        public let linkedAccountsWithIncompleteSetup: [String: LinkedWhatsAppBusinessAccountIdMetaData]?

        @inlinable
        public init(associateInProgressToken: String? = nil, linkedAccountsWithIncompleteSetup: [String: LinkedWhatsAppBusinessAccountIdMetaData]? = nil) {
            self.associateInProgressToken = associateInProgressToken
            self.linkedAccountsWithIncompleteSetup = linkedAccountsWithIncompleteSetup
        }

        private enum CodingKeys: String, CodingKey {
            case associateInProgressToken = "associateInProgressToken"
            case linkedAccountsWithIncompleteSetup = "linkedAccountsWithIncompleteSetup"
        }
    }
}

// MARK: - Errors

/// Error enum for SocialMessaging
public struct SocialMessagingErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedByMetaException = "AccessDeniedByMetaException"
        case accessDeniedException = "AccessDeniedException"
        case dependencyException = "DependencyException"
        case internalServiceException = "InternalServiceException"
        case invalidParametersException = "InvalidParametersException"
        case limitExceededException = "LimitExceededException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case throttledRequestException = "ThrottledRequestException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize SocialMessaging
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// You do not have sufficient access to perform this action.
    public static var accessDeniedByMetaException: Self { .init(.accessDeniedByMetaException) }
    /// You do not have sufficient access to perform this action.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// Thrown when performing an action because a dependency would be broken.
    public static var dependencyException: Self { .init(.dependencyException) }
    /// The request processing has failed because of an unknown error, exception, or failure.
    public static var internalServiceException: Self { .init(.internalServiceException) }
    /// One or more parameters provided to the action are not valid.
    public static var invalidParametersException: Self { .init(.invalidParametersException) }
    /// The request was denied because it would exceed one or more service quotas or limits.
    public static var limitExceededException: Self { .init(.limitExceededException) }
    /// The resource was not found.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// The request was denied due to request throttling.
    public static var throttledRequestException: Self { .init(.throttledRequestException) }
    /// The request contains an invalid parameter value.
    public static var validationException: Self { .init(.validationException) }
}

extension SocialMessagingErrorType: Equatable {
    public static func == (lhs: SocialMessagingErrorType, rhs: SocialMessagingErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension SocialMessagingErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
